<template>
  <el-scrollbar class="full-height">
    <standard-item-detail v-if="standard" v-model="postForm" :is-edit="true" :standard="standard" />
  </el-scrollbar>
</template>

<script>
import StandardItemDetail from '@/views/standard/components/StandardItemDetail'
import { fetchStandard, fetchStandardItem } from '@/api/standard'

export default {
  name: 'StandardItemPanel',
  components: { StandardItemDetail },
  data() {
    return {
      postForm: null,
      standard: null
    }
  },
  created() {
    this.fetchStandardItem()
    this.fetchStandard()
  },
  methods: {
    async fetchStandardItem() {
      const data = await fetchStandardItem(this.$route.query.id)
      this.postForm = data.Data
    },
    async fetchStandard() {
      const data = await fetchStandard(this.$route.query.id.substr(0, 6))
      this.standard = data.Data
    }
  }
}
</script>

<style scoped>

</style>
